﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Linq;

namespace helpcarla
{
    public partial class frmSymptoms : Form
    {
        public frmSymptoms()
        {
            InitializeComponent();
        }

        private void frmSymptoms_Load(object sender, EventArgs e)
        {
            cbSymptomsList.Text = "-- Please select all symptoms that are applicable --";
        }

        private void deleteAllControlsExceptCB()
        {
            System.Collections.Generic.List<System.Windows.Forms.Control> list = new List<System.Windows.Forms.Control>();
            for (int jj = 0; jj < this.Controls.Count; jj++)
            {
                if (this.Controls[jj].Name != "cbSymptomsList")
                {
                    list.Add(this.Controls[jj]);
                }
            }
            for (int jj = 0; jj < list.Count; jj++)
            {
                list[jj].Dispose();
            }
            this.Refresh();
        }

        private bool checkIfRowExists(string rowValue)
        {
            try
            {
                frmMain.connectDB();
                string selectQuery = "SELECT SymptomDescription FROM Symptoms WHERE SymptomDescription=" + rowValue;
                DataSet ds = new DataSet();
                MySql.Data.MySqlClient.MySqlDataAdapter da = new MySql.Data.MySqlClient.MySqlDataAdapter(selectQuery, frmMain.connectDB());
                da.Fill(ds, "Symptoms");

                if (ds.Tables["Symptoms"].Rows.Count < 1)
                {
                    return false;
                }
            }
            catch (MySql.Data.MySqlClient.MySqlException mysqlEX)
            {
                MessageBox.Show("An error has occurred while connecting to the database: " + mysqlEX.Message);
            }
            frmMain.disconnectDB();
            return true;
        }

        private void isCheckedAndAdd(Control ctrl)
        {
            if (ctrl is CheckBox && ((CheckBox)ctrl).Checked)
            {
                if (checkIfRowExists(((CheckBox)ctrl).Name) == false)
                {
                    try
                    {
                        frmMain.connectDB().Open();
                        string insertQuery = "INSERT INTO Symptoms (HasSymptom, DoesntHaveSymptom, SymptomDescription) VALUES('1', '0', ";
                        insertQuery += "\'" + ((CheckBox)ctrl).Name + "\'" + ")";
                        MySql.Data.MySqlClient.MySqlCommand insertCommand = new MySql.Data.MySqlClient.MySqlCommand(insertQuery, frmMain.connectDB());
                        insertCommand.ExecuteNonQuery();
                        frmMain.disconnectDB();
                    }
                    catch (MySql.Data.MySqlClient.MySqlException mysqlEx)
                    {
                        MessageBox.Show("An error has occurred while connecting to the database: " + mysqlEx.Message);
                    }
                }
                else
                {
                    try
                    {
                        frmMain.connectDB().Open();
                        string updateQuery = "UPDATE Symptoms SET HasSymptom=1, DoesntHaveSymptom=0, SymptomDescription=";
                        updateQuery += "\'" + ((CheckBox)ctrl).Name + "\'" + ")";
                        MySql.Data.MySqlClient.MySqlCommand updateCommand = new MySql.Data.MySqlClient.MySqlCommand(updateQuery, frmMain.connectDB());
                        updateCommand.ExecuteNonQuery();
                        frmMain.disconnectDB();
                    }
                    catch (MySql.Data.MySqlClient.MySqlException mysqlEx)
                    {
                        MessageBox.Show("An error has occurred while connecting to the database: " + mysqlEx.Message);
                    }
                }
            }
            if (ctrl is CheckBox && ((CheckBox)ctrl).Checked == false)
            {
                if (checkIfRowExists(((CheckBox)ctrl).Name) == false)
                {
                    try
                    {
                        frmMain.connectDB().Open();
                        string insertQuery = "INSERT INTO Symptoms (HasSymptom, DoesntHaveSymptom, SymptomDescription) VALUES('0', '1', ";
                        insertQuery += "\'" + ((CheckBox)ctrl).Name + "\'" + ")";
                        MySql.Data.MySqlClient.MySqlCommand insertCommand = new MySql.Data.MySqlClient.MySqlCommand(insertQuery, frmMain.connectDB());
                        insertCommand.ExecuteNonQuery();
                        frmMain.disconnectDB();
                    }
                    catch (MySql.Data.MySqlClient.MySqlException mysqlEx)
                    {
                        MessageBox.Show("An error has occurred while connecting to the database: " + mysqlEx.Message);
                    }
                }
                else
                {
                    try
                    {
                        frmMain.connectDB().Open();
                        string updateQuery = "UPDATE Symptoms SET HasSymptom=0, DoesntHaveSymptom=1, SymptomDescription=";
                        updateQuery += "\'" + ((CheckBox)ctrl).Name + "\'" + ")";
                        MySql.Data.MySqlClient.MySqlCommand updateCommand = new MySql.Data.MySqlClient.MySqlCommand(updateQuery, frmMain.connectDB());
                        updateCommand.ExecuteNonQuery();
                        frmMain.disconnectDB();
                    }
                    catch (MySql.Data.MySqlClient.MySqlException mysqlEx)
                    {
                        MessageBox.Show("An error has occurred while connecting to the database: " + mysqlEx.Message);
                    }
                }
            }
            foreach (Control c in ctrl.Controls)
            {
                isCheckedAndAdd(c);
            }
            }

        private void btnSubmit_Click(object sender, EventArgs e)
        {
            isCheckedAndAdd(this);
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void cbSymptomsList_SelectionChangeCommitted(object sender, EventArgs e)
        {
            if (cbSymptomsList.SelectedItem == "The Tick Bite (fewer than 50% recall a tick bite or get/see the rash)")
            {
                this.Text = "Symptoms Checklist: " + cbSymptomsList.SelectedItem;
                this.deleteAllControlsExceptCB();
                this.Size = new Size(326, 269);

                TextBox lblSymptoms = new TextBox();
                lblSymptoms.Name = "lblSymptomsDescription";
                lblSymptoms.Multiline = true;
                lblSymptoms.BorderStyle = BorderStyle.None;
                lblSymptoms.Text = "Please select from the options below, all of the symptoms that you experience.";
                lblSymptoms.ReadOnly = true;
                lblSymptoms.Size = new Size(253, 33);
                lblSymptoms.Location = new Point(12, 12);

                CheckBox chk1 = new CheckBox();
                chk1.Name = "chkTBRash";
                chk1.Text = "Rash at site of bite";
                chk1.Size = new Size(297, 17);
                chk1.Location = new Point(12, 94);

                CheckBox chk2 = new CheckBox();
                chk2.Name = "chkTBRashes";
                chk2.Text = "Rashes  on other parts of your body";
                chk2.Size = new Size(297, 17);
                chk2.Location = new Point(12, 117);

                CheckBox chk3 = new CheckBox();
                chk3.Name = "chkTBCRash";
                chk3.Text = "Rash  basically circular and spreading out (or generalized)";
                chk3.Size = new Size(297, 17);
                chk3.Location = new Point(12, 140);

                CheckBox chk4 = new CheckBox();
                chk4.Name = "chkTBRaisedRash";
                chk4.Text = "Raised rash, disappearing and recurring";
                chk4.Size = new Size(297, 17);
                chk4.Location = new Point(12, 163);

                Button btnSubmit = new Button();
                btnSubmit.Name = "btnSubmit";
                btnSubmit.Text = "Submit";
                btnSubmit.Location = new Point(43, 198);
                btnSubmit.Click += new EventHandler(btnSubmit_Click);

                Button btnCancel = new Button();
                btnCancel.Name = "btnCancel";
                btnCancel.Text = "Cancel";
                btnCancel.Location = new Point(155, 198);
                btnCancel.Click += new EventHandler(btnCancel_Click);

                this.Controls.Add(lblSymptoms);
                this.Controls.Add(chk1);
                this.Controls.Add(chk2);
                this.Controls.Add(chk3);
                this.Controls.Add(chk4);
                this.Controls.Add(btnSubmit);
                this.Controls.Add(btnCancel);
            }

            if (cbSymptomsList.SelectedItem == "Head, Face, Neck")
            {
                this.Text = "Symptoms Checklist: " + cbSymptomsList.SelectedItem;
                this.deleteAllControlsExceptCB();
                this.Size = new Size(399, 413);

                TextBox lblSymptoms = new TextBox();
                lblSymptoms.Name = "lblSymptomsDescription";
                lblSymptoms.Multiline = true;
                lblSymptoms.BorderStyle = BorderStyle.None;
                lblSymptoms.Text = "Please select from the options below, all of the symptoms that you experience.";
                lblSymptoms.ReadOnly = true;
                lblSymptoms.Size = new Size(253, 33);
                lblSymptoms.Location = new Point(12, 12);

                CheckBox chk1 = new CheckBox();
                chk1.Name = "chkHFNHair";
                chk1.Text = "Unexplained hair loss";
                chk1.Size = new Size(287, 17);
                chk1.Location = new Point(12, 90);

                CheckBox chk2 = new CheckBox();
                chk2.Name = "chkHFNSeizures";
                chk2.Text = "Headache, mild or severe, Seizures";
                chk2.Size = new Size(287, 17);
                chk2.Location = new Point(12, 113);

                CheckBox chk3 = new CheckBox();
                chk3.Name = "chkHFNPressure";
                chk3.Text = "Pressure in Head, White Matter Lesions in Head (MRI)";
                chk3.Size = new Size(287, 17);
                chk3.Location = new Point(12, 136);

                CheckBox chk4 = new CheckBox();
                chk4.Name = "chkHFNTwitching";
                chk4.Text = "Twitching of facial or other muscles";
                chk4.Size = new Size(287, 17);
                chk4.Location = new Point(12, 159);

                CheckBox chk5 = new CheckBox();
                chk5.Name = "chkHFNParalysis";
                chk5.Text = "Facial paralysis (Bell's Palsy)";
                chk5.Size = new Size(287, 17);
                chk5.Location = new Point(12, 182);

                CheckBox chk6 = new CheckBox();
                chk6.Name = "chkHFNTingling";
                chk6.Text = "Tingling of nose, (tip of) tongue, cheek or facial flushing";
                chk6.Size = new Size(287, 17);
                chk6.Location = new Point(12, 205);

                CheckBox chk7 = new CheckBox();
                chk7.Name = "chkHFNStiff";
                chk7.Text = "Stiff or painful neck";
                chk7.Size = new Size(287, 17);
                chk7.Location = new Point(12, 228);

                CheckBox chk8 = new CheckBox();
                chk8.Name = "chkHFNJaw";
                chk8.Text = "Jaw pain or stiffness";
                chk8.Size = new Size(287, 17);
                chk8.Location = new Point(12, 251);

                CheckBox chk9 = new CheckBox();
                chk9.Name = "chkHFNDental";
                chk9.Text = "Dental problems (unexplained)";
                chk9.Size = new Size(287, 17);
                chk9.Location = new Point(12, 274);

                CheckBox chk10 = new CheckBox();
                chk10.Name = "chkHFNThroat";
                chk10.Text = "Sore throat, clearing throat a lot, phlegm ( flem ), hoarseness, runny nose";
                chk10.Size = new Size(399, 17);
                chk10.Location = new Point(12, 297);

                Button btnSubmit = new Button();
                btnSubmit.Name = "btnSubmit";
                btnSubmit.Text = "Submit";
                btnSubmit.Location = new Point(37, 342);
                btnSubmit.Click += new EventHandler(btnSubmit_Click);

                Button btnCancel = new Button();
                btnCancel.Name = "btnCancel";
                btnCancel.Text = "Cancel";
                btnCancel.Location = new Point(151, 342);
                btnCancel.Click += new EventHandler(btnCancel_Click);

                this.Controls.Add(lblSymptoms);
                this.Controls.Add(chk1);
                this.Controls.Add(chk2);
                this.Controls.Add(chk3);
                this.Controls.Add(chk4);
                this.Controls.Add(chk5);
                this.Controls.Add(chk6);
                this.Controls.Add(chk7);
                this.Controls.Add(chk8);
                this.Controls.Add(chk9);
                this.Controls.Add(chk10);
                this.Controls.Add(btnSubmit);
                this.Controls.Add(btnCancel);
            }

            if (cbSymptomsList.SelectedItem == "Eyes/Vision")
            {
                this.Text = "Symptoms Checklist: " + cbSymptomsList.SelectedItem;
                this.deleteAllControlsExceptCB();
                this.Size = new Size(375, 280);

                TextBox lblSymptoms = new TextBox();
                lblSymptoms.Name = "lblSymptomsDescription";
                lblSymptoms.Multiline = true;
                lblSymptoms.BorderStyle = BorderStyle.None;
                lblSymptoms.Text = "Please select from the options below, all of the symptoms that you experience.";
                lblSymptoms.ReadOnly = true;
                lblSymptoms.Size = new Size(253, 33);
                lblSymptoms.Location = new Point(12, 12);

                CheckBox chk1 = new CheckBox();
                chk1.Name = "chkBlurry";
                chk1.Text = "Double or blurry vision";
                chk1.Size = new Size(287, 17);
                chk1.Location = new Point(12, 90);

                CheckBox chk2 = new CheckBox();
                chk2.Name = "chkFloatingSpots";
                chk2.Text = "Increased floating spots";
                chk2.Size = new Size(287, 17);
                chk2.Location = new Point(12, 113);

                CheckBox chk3 = new CheckBox();
                chk3.Name = "chkEyePain";
                chk3.Text = "Pain in eyes, or swelling around eyes";
                chk3.Size = new Size(287, 17);
                chk3.Location = new Point(12, 136);

                CheckBox chk4 = new CheckBox();
                chk4.Name = "chkLightSensitivity";
                chk4.Text = "Oversensitivity to light";
                chk4.Size = new Size(287, 17);
                chk4.Location = new Point(12, 159);

                CheckBox chk5 = new CheckBox();
                chk5.Name = "chkFlashingLights";
                chk5.Text = "Flashing lights/Peripheral waves/phantom images in corner of eyes";
                chk5.Size = new Size(350, 17);
                chk5.Location = new Point(12, 182);

                Button btnSubmit = new Button();
                btnSubmit.Name = "btnSubmit";
                btnSubmit.Text = "Submit";
                btnSubmit.Location = new Point(37, 210);
                btnSubmit.Click += new EventHandler(btnSubmit_Click);

                Button btnCancel = new Button();
                btnCancel.Name = "btnCancel";
                btnCancel.Text = "Cancel";
                btnCancel.Location = new Point(151, 210);
                btnCancel.Click += new EventHandler(btnCancel_Click);

                this.Controls.Add(lblSymptoms);
                this.Controls.Add(chk1);
                this.Controls.Add(chk2);
                this.Controls.Add(chk3);
                this.Controls.Add(chk4);
                this.Controls.Add(chk5);
                this.Controls.Add(btnSubmit);
                this.Controls.Add(btnCancel);
            }

            if (cbSymptomsList.SelectedItem == "Ears/Hearing")
            {
                this.Text = "Symptoms Checklist: " + cbSymptomsList.SelectedItem;
                this.deleteAllControlsExceptCB();
                this.Size = new Size(300, 260);

                TextBox lblSymptoms = new TextBox();
                lblSymptoms.Name = "lblSymptomsDescription";
                lblSymptoms.Multiline = true;
                lblSymptoms.BorderStyle = BorderStyle.None;
                lblSymptoms.Text = "Please select from the options below, all of the symptoms that you experience.";
                lblSymptoms.ReadOnly = true;
                lblSymptoms.TabStop = false;
                lblSymptoms.Size = new Size(253, 33);
                lblSymptoms.Location = new Point(12, 12);

                CheckBox chk1 = new CheckBox();
                chk1.Name = "chkHPlugged";
                chk1.Text = "Decreased hearing in one or both ears, plugged ears";
                chk1.Size = new Size(287, 17);
                chk1.Location = new Point(12, 90);

                CheckBox chk2 = new CheckBox();
                chk2.Name = "chkHBuzzing";
                chk2.Text = "Buzzing in ears";
                chk2.Size = new Size(287, 17);
                chk2.Location = new Point(12, 113);

                CheckBox chk3 = new CheckBox();
                chk3.Name = "chkHPain";
                chk3.Text = "Pain in ears, oversensitivity to sounds";
                chk3.Size = new Size(287, 17);
                chk3.Location = new Point(12, 136);

                CheckBox chk4 = new CheckBox();
                chk4.Name = "chkHRinging";
                chk4.Text = "Ringing in one or both ears";
                chk4.Size = new Size(287, 17);
                chk4.Location = new Point(12, 159);

                Button btnSubmit = new Button();
                btnSubmit.Name = "btnSubmit";
                btnSubmit.Text = "Submit";
                btnSubmit.Location = new Point(37, 190);
                btnSubmit.Click += new EventHandler(btnSubmit_Click);

                Button btnCancel = new Button();
                btnCancel.Name = "btnCancel";
                btnCancel.Text = "Cancel";
                btnCancel.Location = new Point(151, 190);
                btnCancel.Click += new EventHandler(btnCancel_Click);

                this.Controls.Add(lblSymptoms);
                this.Controls.Add(chk1);
                this.Controls.Add(chk2);
                this.Controls.Add(chk3);
                this.Controls.Add(chk4);
                this.Controls.Add(btnSubmit);
                this.Controls.Add(btnCancel);
            }

            if (cbSymptomsList.SelectedItem == "Digestive and Excretory Systems")
            {
                this.Text = "Symptoms Checklist: " + cbSymptomsList.SelectedItem;
                this.deleteAllControlsExceptCB();
                this.Size = new Size(415, 260);

                TextBox lblSymptoms = new TextBox();
                lblSymptoms.Name = "lblSymptomsDescription";
                lblSymptoms.Multiline = true;
                lblSymptoms.BorderStyle = BorderStyle.None;
                lblSymptoms.Text = "Please select from the options below, all of the symptoms that you experience.";
                lblSymptoms.ReadOnly = true;
                lblSymptoms.TabStop = false;
                lblSymptoms.Size = new Size(253, 33);
                lblSymptoms.Location = new Point(12, 12);

                CheckBox chk1 = new CheckBox();
                chk1.Name = "chkDiarrhea";
                chk1.Text = "Diarrhea";
                chk1.Size = new Size(287, 17);
                chk1.Location = new Point(12, 90);

                CheckBox chk2 = new CheckBox();
                chk2.Name = "chkConstipation";
                chk2.Text = "Constipation";
                chk2.Size = new Size(287, 17);
                chk2.Location = new Point(12, 113);

                CheckBox chk3 = new CheckBox();
                chk3.Name = "chkBladder";
                chk3.Text = "Irritable bladder (trouble starting, stopping) or Interstitial cystitis";
                chk3.Size = new Size(350, 17);
                chk3.Location = new Point(12, 136);

                CheckBox chk4 = new CheckBox();
                chk4.Name = "chkStomach";
                chk4.Text = "Upset stomach (nausea or pain) or GERD (gastroesophageal reflux disease)";
                chk4.Size = new Size(390, 17);
                chk4.Location = new Point(12, 159);

                Button btnSubmit = new Button();
                btnSubmit.Name = "btnSubmit";
                btnSubmit.Text = "Submit";
                btnSubmit.Location = new Point(37, 190);
                btnSubmit.Click += new EventHandler(btnSubmit_Click);

                Button btnCancel = new Button();
                btnCancel.Name = "btnCancel";
                btnCancel.Text = "Cancel";
                btnCancel.Location = new Point(151, 190);
                btnCancel.Click += new EventHandler(btnCancel_Click);

                this.Controls.Add(lblSymptoms);
                this.Controls.Add(chk1);
                this.Controls.Add(chk2);
                this.Controls.Add(chk3);
                this.Controls.Add(chk4);
                this.Controls.Add(btnSubmit);
                this.Controls.Add(btnCancel);
            }

            if (cbSymptomsList.SelectedItem == "Musculoskeletal System")
            {
                this.Text = "Symptoms Checklist: " + cbSymptomsList.SelectedItem;
                this.deleteAllControlsExceptCB();
                this.Size = new Size(325, 240);

                TextBox lblSymptoms = new TextBox();
                lblSymptoms.Name = "lblSymptomsDescription";
                lblSymptoms.Multiline = true;
                lblSymptoms.BorderStyle = BorderStyle.None;
                lblSymptoms.Text = "Please select from the options below, all of the symptoms that you experience.";
                lblSymptoms.ReadOnly = true;
                lblSymptoms.TabStop = false;
                lblSymptoms.Size = new Size(253, 33);
                lblSymptoms.Location = new Point(12, 12);

                CheckBox chk1 = new CheckBox();
                chk1.Name = "chkBonePain";
                chk1.Text = "Bone pain, joint pain or swelling, carpal tunnel syndrome";
                chk1.Size = new Size(320, 17);
                chk1.Location = new Point(12, 90);

                CheckBox chk2 = new CheckBox();
                chk2.Name = "chkJoints";
                chk2.Text = "Stiffness of joints, back, neck, tennis elbow";
                chk2.Size = new Size(287, 17);
                chk2.Location = new Point(12, 113);

                CheckBox chk3 = new CheckBox();
                chk3.Name = "chkMusclePain";
                chk3.Text = "Muscle pain or cramps, (Fibromyalgia)";
                chk3.Size = new Size(287, 17);
                chk3.Location = new Point(12, 136);

                Button btnSubmit = new Button();
                btnSubmit.Name = "btnSubmit";
                btnSubmit.Text = "Submit";
                btnSubmit.Location = new Point(37, 165);
                btnSubmit.Click += new EventHandler(btnSubmit_Click);

                Button btnCancel = new Button();
                btnCancel.Name = "btnCancel";
                btnCancel.Text = "Cancel";
                btnCancel.Location = new Point(151, 165);
                btnCancel.Click += new EventHandler(btnCancel_Click);

                this.Controls.Add(lblSymptoms);
                this.Controls.Add(chk1);
                this.Controls.Add(chk2);
                this.Controls.Add(chk3);
                this.Controls.Add(btnSubmit);
                this.Controls.Add(btnCancel);
            }

            if (cbSymptomsList.SelectedItem == "Respiratory and Circulatory Systems")
            {
                this.Text = "Symptoms Checklist: " + cbSymptomsList.SelectedItem;
                this.deleteAllControlsExceptCB();
                this.Size = new Size(330, 280);

                TextBox lblSymptoms = new TextBox();
                lblSymptoms.Name = "lblSymptomsDescription";
                lblSymptoms.Multiline = true;
                lblSymptoms.BorderStyle = BorderStyle.None;
                lblSymptoms.Text = "Please select from the options below, all of the symptoms that you experience.";
                lblSymptoms.ReadOnly = true;
                lblSymptoms.Size = new Size(253, 33);
                lblSymptoms.Location = new Point(12, 12);

                CheckBox chk1 = new CheckBox();
                chk1.Name = "chkBreath";
                chk1.Text = "Shortness of breath, can't get full/satisfying breath, cough";
                chk1.Size = new Size(300, 17);
                chk1.Location = new Point(12, 90);

                CheckBox chk2 = new CheckBox();
                chk2.Name = "chkChestPain";
                chk2.Text = "Chest pain or rib soreness";
                chk2.Size = new Size(287, 17);
                chk2.Location = new Point(12, 113);

                CheckBox chk3 = new CheckBox();
                chk3.Name = "chkNightSweats";
                chk3.Text = "Night sweats or unexplained chills";
                chk3.Size = new Size(287, 17);
                chk3.Location = new Point(12, 136);

                CheckBox chk4 = new CheckBox();
                chk4.Name = "chkExtraHeartBeats";
                chk4.Text = "Heart palpitations or extra beats";
                chk4.Size = new Size(287, 17);
                chk4.Location = new Point(12, 159);

                CheckBox chk5 = new CheckBox();
                chk5.Name = "chkHeartBlockage";
                chk5.Text = "Endocarditis, Heart blockage";
                chk5.Size = new Size(350, 17);
                chk5.Location = new Point(12, 182);

                Button btnSubmit = new Button();
                btnSubmit.Name = "btnSubmit";
                btnSubmit.Text = "Submit";
                btnSubmit.Location = new Point(37, 210);
                btnSubmit.Click += new EventHandler(btnSubmit_Click);

                Button btnCancel = new Button();
                btnCancel.Name = "btnCancel";
                btnCancel.Text = "Cancel";
                btnCancel.Location = new Point(151, 210);
                btnCancel.Click += new EventHandler(btnCancel_Click);

                this.Controls.Add(lblSymptoms);
                this.Controls.Add(chk1);
                this.Controls.Add(chk2);
                this.Controls.Add(chk3);
                this.Controls.Add(chk4);
                this.Controls.Add(chk5);
                this.Controls.Add(btnSubmit);
                this.Controls.Add(btnCancel);
            }

            if (cbSymptomsList.SelectedItem == "Neurologic System")
            {
                this.Text = "Symptoms Checklist: " + cbSymptomsList.SelectedItem;
                this.deleteAllControlsExceptCB();
                this.Size = new Size(475, 350);

                TextBox lblSymptoms = new TextBox();
                lblSymptoms.Name = "lblSymptomsDescription";
                lblSymptoms.Multiline = true;
                lblSymptoms.BorderStyle = BorderStyle.None;
                lblSymptoms.Text = "Please select from the options below, all of the symptoms that you experience.";
                lblSymptoms.ReadOnly = true;
                lblSymptoms.Size = new Size(475, 15);
                lblSymptoms.Location = new Point(12, 12);

                CheckBox chk1 = new CheckBox();
                chk1.Name = "chkTremors";
                chk1.Text = "Tremors or unexplained shaking";
                chk1.Size = new Size(287, 17);
                chk1.Location = new Point(12, 90);

                CheckBox chk2 = new CheckBox();
                chk2.Name = "chkStabbingSensations";
                chk2.Text = "Burning or stabbing sensations in the body";
                chk2.Size = new Size(287, 17);
                chk2.Location = new Point(12, 113);

                CheckBox chk3 = new CheckBox();
                chk3.Name = "chkCFS";
                chk3.Text = "Fatigue, Chronic Fatigue Syndrome, Weakness, peripheral neuropathy or partial paralysis";
                chk3.Size = new Size(450, 17);
                chk3.Location = new Point(12, 136);

                CheckBox chk4 = new CheckBox();
                chk4.Name = "chkHeadPressure";
                chk4.Text = "Pressure in the head";
                chk4.Size = new Size(287, 17);
                chk4.Location = new Point(12, 159);

                CheckBox chk5 = new CheckBox();
                chk5.Name = "chkBodyNumbness";
                chk5.Text = "Numbness in body, tingling, pinpricks";
                chk5.Size = new Size(287, 17);
                chk5.Location = new Point(12, 182);

                CheckBox chk6 = new CheckBox();
                chk6.Name = "chkPoorBalance";
                chk6.Text = "Poor balance, dizziness, difficulty walking";
                chk6.Size = new Size(287, 17);
                chk6.Location = new Point(12, 205);

                CheckBox chk7 = new CheckBox();
                chk7.Name = "chkMotionSickness";
                chk7.Text = "Increased motion sickness";
                chk7.Size = new Size(287, 17);
                chk7.Location = new Point(12, 228);

                CheckBox chk8 = new CheckBox();
                chk8.Name = "chkWooziness";
                chk8.Text = "Lightheadedness, wooziness";
                chk8.Size = new Size(287, 17);
                chk8.Location = new Point(12, 251);

                Button btnSubmit = new Button();
                btnSubmit.Name = "btnSubmit";
                btnSubmit.Text = "Submit";
                btnSubmit.Location = new Point(50, 275);
                btnSubmit.Click += new EventHandler(btnSubmit_Click);

                Button btnCancel = new Button();
                btnCancel.Name = "btnCancel";
                btnCancel.Text = "Cancel";
                btnCancel.Location = new Point(200, 275);
                btnCancel.Click += new EventHandler(btnCancel_Click);

                this.Controls.Add(lblSymptoms);
                this.Controls.Add(chk1);
                this.Controls.Add(chk2);
                this.Controls.Add(chk3);
                this.Controls.Add(chk4);
                this.Controls.Add(chk5);
                this.Controls.Add(chk6);
                this.Controls.Add(chk7);
                this.Controls.Add(chk8);
                this.Controls.Add(btnSubmit);
                this.Controls.Add(btnCancel);
            }

            if (cbSymptomsList.SelectedItem == "Psychological well-being")
            {
                this.Text = "Symptoms Checklist: " + cbSymptomsList.SelectedItem;
                this.deleteAllControlsExceptCB();
                this.Size = new Size(300, 370);

                TextBox lblSymptoms = new TextBox();
                lblSymptoms.Name = "lblSymptomsDescription";
                lblSymptoms.Multiline = true;
                lblSymptoms.BorderStyle = BorderStyle.None;
                lblSymptoms.Text = "Please select from the options below, all of the symptoms that you experience.";
                lblSymptoms.ReadOnly = true;
                lblSymptoms.Size = new Size(253, 33);
                lblSymptoms.Location = new Point(12, 12);

                CheckBox chk1 = new CheckBox();
                chk1.Name = "chkMoodSwings";
                chk1.Text = "Mood swings, irritability, bi-polar disorder";
                chk1.Size = new Size(287, 17);
                chk1.Location = new Point(12, 90);

                CheckBox chk2 = new CheckBox();
                chk2.Name = "chkDepression";
                chk2.Text = "Unusual depression";
                chk2.Size = new Size(287, 17);
                chk2.Location = new Point(12, 113);

                CheckBox chk3 = new CheckBox();
                chk3.Name = "chkDisorientation";
                chk3.Text = "Disorientation (getting or feeling lost)";
                chk3.Size = new Size(287, 17);
                chk3.Location = new Point(12, 136);

                CheckBox chk4 = new CheckBox();
                chk4.Name = "chkLosingMind";
                chk4.Text = "Feeling as if you are losing your mind";
                chk4.Size = new Size(287, 17);
                chk4.Location = new Point(12, 159);

                CheckBox chk5 = new CheckBox();
                chk5.Name = "chkOverEmotional";
                chk5.Text = "Over-emotional reactions, crying easily";
                chk5.Size = new Size(287, 17);
                chk5.Location = new Point(12, 182);

                CheckBox chk6 = new CheckBox();
                chk6.Name = "chkInsomnia";
                chk6.Text = "Too much sleep, or insomnia";
                chk6.Size = new Size(287, 17);
                chk6.Location = new Point(12, 205);

                CheckBox chk7 = new CheckBox();
                chk7.Name = "chkFallingAsleep";
                chk7.Text = "Difficulty falling or staying asleep";
                chk7.Size = new Size(287, 17);
                chk7.Location = new Point(12, 228);

                CheckBox chk8 = new CheckBox();
                chk8.Name = "chkNarcolepsy";
                chk8.Text = "Narcolepsy, sleep apnea";
                chk8.Size = new Size(287, 17);
                chk8.Location = new Point(12, 251);

                CheckBox chk9 = new CheckBox();
                chk9.Name = "chkPanicAttacks";
                chk9.Text = "Panic attacks, anxiety";
                chk9.Size = new Size(287, 17);
                chk9.Location = new Point(12, 274);

                Button btnSubmit = new Button();
                btnSubmit.Name = "btnSubmit";
                btnSubmit.Text = "Submit";
                btnSubmit.Location = new Point(37, 300);
                btnSubmit.Click += new EventHandler(btnSubmit_Click);

                Button btnCancel = new Button();
                btnCancel.Name = "btnCancel";
                btnCancel.Text = "Cancel";
                btnCancel.Location = new Point(151, 300);
                btnCancel.Click += new EventHandler(btnCancel_Click);

                this.Controls.Add(lblSymptoms);
                this.Controls.Add(chk1);
                this.Controls.Add(chk2);
                this.Controls.Add(chk3);
                this.Controls.Add(chk4);
                this.Controls.Add(chk5);
                this.Controls.Add(chk6);
                this.Controls.Add(chk7);
                this.Controls.Add(chk8);
                this.Controls.Add(chk9);
                this.Controls.Add(btnSubmit);
                this.Controls.Add(btnCancel);
            }

            if (cbSymptomsList.SelectedItem == "Mental Capability")
            {
                this.Text = "Symptoms Checklist: " + cbSymptomsList.SelectedItem;
                this.deleteAllControlsExceptCB();
                this.Size = new Size(300, 320);

                TextBox lblSymptoms = new TextBox();
                lblSymptoms.Name = "lblSymptomsDescription";
                lblSymptoms.Multiline = true;
                lblSymptoms.BorderStyle = BorderStyle.None;
                lblSymptoms.Text = "Please select from the options below, all of the symptoms that you experience.";
                lblSymptoms.ReadOnly = true;
                lblSymptoms.Size = new Size(253, 33);
                lblSymptoms.Location = new Point(12, 12);

                CheckBox chk1 = new CheckBox();
                chk1.Name = "chkMemoryLoss";
                chk1.Text = "Memory loss (short or long term)";
                chk1.Size = new Size(287, 17);
                chk1.Location = new Point(12, 90);

                CheckBox chk2 = new CheckBox();
                chk2.Name = "chkConfusion";
                chk2.Text = "Confusion, difficulty in thinking";
                chk2.Size = new Size(287, 17);
                chk2.Location = new Point(12, 113);

                CheckBox chk3 = new CheckBox();
                chk3.Name = "chkConcentration";
                chk3.Text = "Difficulty with concentration or reading";
                chk3.Size = new Size(287, 17);
                chk3.Location = new Point(12, 136);

                CheckBox chk4 = new CheckBox();
                chk4.Name = "chkWrongPlace";
                chk4.Text = "Going to the wrong place";
                chk4.Size = new Size(287, 17);
                chk4.Location = new Point(12, 159);

                CheckBox chk5 = new CheckBox();
                chk5.Name = "chkSpeech";
                chk5.Text = "Speech difficulty (slurred or slow)";
                chk5.Size = new Size(287, 17);
                chk5.Location = new Point(12, 182);

                CheckBox chk6 = new CheckBox();
                chk6.Name = "chkStammeringSpeech";
                chk6.Text = "Stammering speech";
                chk6.Size = new Size(287, 17);
                chk6.Location = new Point(12, 205);

                CheckBox chk7 = new CheckBox();
                chk7.Name = "chkForgettingSimpleTasks";
                chk7.Text = "Forgetting how to perform simple tasks";
                chk7.Size = new Size(287, 17);
                chk7.Location = new Point(12, 228);

                Button btnSubmit = new Button();
                btnSubmit.Name = "btnSubmit";
                btnSubmit.Text = "Submit";
                btnSubmit.Location = new Point(37, 250);
                btnSubmit.Click += new EventHandler(btnSubmit_Click);

                Button btnCancel = new Button();
                btnCancel.Name = "btnCancel";
                btnCancel.Text = "Cancel";
                btnCancel.Location = new Point(151, 250);
                btnCancel.Click += new EventHandler(btnCancel_Click);

                this.Controls.Add(lblSymptoms);
                this.Controls.Add(chk1);
                this.Controls.Add(chk2);
                this.Controls.Add(chk3);
                this.Controls.Add(chk4);
                this.Controls.Add(chk5);
                this.Controls.Add(chk6);
                this.Controls.Add(chk7);
                this.Controls.Add(btnSubmit);
                this.Controls.Add(btnCancel);
            }

            if (cbSymptomsList.SelectedItem == "Reproduction and Sexuality")
            {
                this.Text = "Symptoms Checklist: " + cbSymptomsList.SelectedItem;
                this.deleteAllControlsExceptCB();
                this.Size = new Size(300, 280);

                TextBox lblSymptoms = new TextBox();
                lblSymptoms.Name = "lblSymptomsDescription";
                lblSymptoms.Multiline = true;
                lblSymptoms.BorderStyle = BorderStyle.None;
                lblSymptoms.Text = "Please select from the options below, all of the symptoms that you experience.";
                lblSymptoms.ReadOnly = true;
                lblSymptoms.Size = new Size(253, 33);
                lblSymptoms.Location = new Point(12, 12);

                CheckBox chk1 = new CheckBox();
                chk1.Name = "chkSexDrive";
                chk1.Text = "Loss of sex drive";
                chk1.Size = new Size(300, 17);
                chk1.Location = new Point(12, 90);

                CheckBox chk2 = new CheckBox();
                chk2.Name = "chkSexualDysfunction";
                chk2.Text = "Sexual dysfunction";
                chk2.Size = new Size(287, 17);
                chk2.Location = new Point(12, 113);

                CheckBox chk3 = new CheckBox();
                chk3.Name = "chkMenstralPain";
                chk3.Text = "Unexplained menstral pain, irregularity";
                chk3.Size = new Size(287, 17);
                chk3.Location = new Point(12, 136);

                CheckBox chk4 = new CheckBox();
                chk4.Name = "chkBreastPain";
                chk4.Text = "Unexplained breast pain, discharge";
                chk4.Size = new Size(287, 17);
                chk4.Location = new Point(12, 159);

                CheckBox chk5 = new CheckBox();
                chk5.Name = "chkPelvicPain";
                chk5.Text = "Testicular or pelvic pain";
                chk5.Size = new Size(350, 17);
                chk5.Location = new Point(12, 182);

                Button btnSubmit = new Button();
                btnSubmit.Name = "btnSubmit";
                btnSubmit.Text = "Submit";
                btnSubmit.Location = new Point(37, 210);
                btnSubmit.Click += new EventHandler(btnSubmit_Click);

                Button btnCancel = new Button();
                btnCancel.Name = "btnCancel";
                btnCancel.Text = "Cancel";
                btnCancel.Location = new Point(151, 210);
                btnCancel.Click += new EventHandler(btnCancel_Click);

                this.Controls.Add(lblSymptoms);
                this.Controls.Add(chk1);
                this.Controls.Add(chk2);
                this.Controls.Add(chk3);
                this.Controls.Add(chk4);
                this.Controls.Add(chk5);
                this.Controls.Add(btnSubmit);
                this.Controls.Add(btnCancel);
            }

            if (cbSymptomsList.SelectedItem == "General Well-being")
            {
                this.Text = "Symptoms Checklist: " + cbSymptomsList.SelectedItem;
                this.deleteAllControlsExceptCB();
                this.Size = new Size(420, 400);

                TextBox lblSymptoms = new TextBox();
                lblSymptoms.Name = "lblSymptomsDescription";
                lblSymptoms.Multiline = true;
                lblSymptoms.BorderStyle = BorderStyle.None;
                lblSymptoms.Text = "Please select from the options below, all of the symptoms that you experience.";
                lblSymptoms.ReadOnly = true;
                lblSymptoms.Size = new Size(253, 33);
                lblSymptoms.Location = new Point(12, 12);

                CheckBox chk1 = new CheckBox();
                chk1.Name = "chkWeight";
                chk1.Text = "Unexplained weight gain, loss";
                chk1.Size = new Size(287, 17);
                chk1.Location = new Point(12, 90);

                CheckBox chk2 = new CheckBox();
                chk2.Name = "chkFatigue";
                chk2.Text = "Extreme fatigue";
                chk2.Size = new Size(287, 17);
                chk2.Location = new Point(12, 113);

                CheckBox chk3 = new CheckBox();
                chk3.Name = "chkLymphNodes";
                chk3.Text = "Swollen glands/lymph nodes";
                chk3.Size = new Size(287, 17);
                chk3.Location = new Point(12, 136);

                CheckBox chk4 = new CheckBox();
                chk4.Name = "chkUnexplainedFevers";
                chk4.Text = "Unexplained fevers (high or low grade)";
                chk4.Size = new Size(287, 17);
                chk4.Location = new Point(12, 159);

                CheckBox chk5 = new CheckBox();
                chk5.Name = "chkInfections";
                chk5.Text = "Continual infections (sinus, kidney, eye, etc.)";
                chk5.Size = new Size(287, 17);
                chk5.Location = new Point(12, 182);

                CheckBox chk6 = new CheckBox();
                chk6.Name = "chkSymptomsChange";
                chk6.Text = "Symptoms seem to change, come and go";
                chk6.Size = new Size(287, 17);
                chk6.Location = new Point(12, 205);

                CheckBox chk7 = new CheckBox();
                chk7.Name = "chkPainMigrates";
                chk7.Text = "Pain migrates (moves) to different body parts";
                chk7.Size = new Size(287, 17);
                chk7.Location = new Point(12, 228);

                CheckBox chk8 = new CheckBox();
                chk8.Name = "chkFluLike";
                chk8.Text = "Early on, experienced a " + "flu-like" + " illness, after which you have not since felt well";
                chk8.Size = new Size(400, 17);
                chk8.Location = new Point(12, 251);

                CheckBox chk9 = new CheckBox();
                chk9.Name = "chkLowTemperature";
                chk9.Text = "Low body temperature";
                chk9.Size = new Size(287, 17);
                chk9.Location = new Point(12, 274);

                CheckBox chk10 = new CheckBox();
                chk10.Name = "chkAllergies";
                chk10.Text = "Allergies/Chemical sensitivities";
                chk10.Size = new Size(399, 17);
                chk10.Location = new Point(12, 297);

                CheckBox chk11 = new CheckBox();
                chk11.Name = "chkIncreasedHangover";
                chk11.Text = "Increased effect from alcohol and possible worse hangover";
                chk11.Size = new Size(399, 17);
                chk11.Location = new Point(12, 297);

                Button btnSubmit = new Button();
                btnSubmit.Name = "btnSubmit";
                btnSubmit.Text = "Submit";
                btnSubmit.Location = new Point(37, 330);
                btnSubmit.Click += new EventHandler(btnSubmit_Click);

                Button btnCancel = new Button();
                btnCancel.Name = "btnCancel";
                btnCancel.Text = "Cancel";
                btnCancel.Location = new Point(151, 330);
                btnCancel.Click += new EventHandler(btnCancel_Click);

                this.Controls.Add(lblSymptoms);
                this.Controls.Add(chk1);
                this.Controls.Add(chk2);
                this.Controls.Add(chk3);
                this.Controls.Add(chk4);
                this.Controls.Add(chk5);
                this.Controls.Add(chk6);
                this.Controls.Add(chk7);
                this.Controls.Add(chk8);
                this.Controls.Add(chk9);
                this.Controls.Add(chk10);
                this.Controls.Add(chk11);
                this.Controls.Add(btnSubmit);
                this.Controls.Add(btnCancel);
            }
        }
    }
}
